package com.vallis.asfc.demo;

import io.jsonwebtoken.JwtBuilder;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.SignatureAlgorithm;

import java.util.Date;

/**
 * @author vallis
 * @version 1.0
 * @date 2020/6/29 12:46
 */
public class CreateJwtToken {
    /**
     *
     * @param args
     */
    public static void main(String[] args) {
        JwtBuilder builder= Jwts.builder().setId("222")
        .setSubject("vallis").setIssuedAt(new Date())
                .signWith(SignatureAlgorithm.HS256,"vallis").claim("certnum",123456);

        String token = builder.compact();

        System.out.println(token);
    }
}
